<template>
	<div class="sec-top">
		<button class="btn btn-sm btn-primary" @click = "saveItem({startTime: '',endTime: ''},'新增')">新增</button>
	</div>
	<table class="table table-bordered">
		<caption>投资大讲堂列表</caption>
		<thead>
			<tr>
				<th>id</th>
				<th colspan="4" class="col-xs-6">信息</th>
        <th colspan="2">时间</th>
				<th></th>
			</tr>
		</thead>
		<tbody>
      <template v-for="item in cList">
  			<tr>
  				<td rowspan="4" class="col-nowrap">{{item.id}}</td>
          <td class="text-right col-nowrap">标题</td>
  				<td>{{item.title}}</td>
          <td class="text-right col-nowrap">主讲人</td>
          <td class="col-nowrap">{{item.speaker}}</td>
          <td class="text-right col-nowrap">开始</td>
  				<td>{{item.startTime}}</td>
  				<td rowspan="4" class="text-right col-nowrap">
            <button class="btn btn-sm btn-success" v-if=" +item.top === 0 " @click="topItem(item.id, 1)">置顶</button>
            <button class="btn btn-sm btn-success" v-if=" +item.top === 1 " @click="topItem(item.id, 0)">取消置顶</button>
            <button class="btn btn-sm btn-primary" @click="saveItem(item,'修改')">修改</button>
            <button class="btn btn-sm btn-danger" @click="deleteItem(item.id)">删除</button>
  				</td>
  			</tr>
        <tr>
          <td class="text-right col-nowrap">配图</td>
          <td colspan="3"><img class="list-pic" :src="item.picUrl"></td>
          <td rowspan="3" class="text-right col-nowrap">结束</td>
          <td rowspan="3">{{item.endTime}}</td>
        </tr>
        <tr>
          <td class="text-right col-nowrap">纪要文章链接</td>
          <td colspan="3">{{item.contentUrl}}</td>
        </tr>
        <tr>
          <td class="text-right col-nowrap">大讲堂链接</td>
          <td colspan="3">{{item.lectureUrl}}</td>
        </tr>
      </template>
		</tbody>
	</table>
	 <vue-save :show-save.sync="showSave" :it="it" :title= "title"></vue-save>
</template>
<style src="./list.css" scoped></style>
<script type="text/javascript" src="./list.js"></script>
